<?php

class Social_Controller_Browse_Live_Oauth2callback
{

	function execute($request)
	{
		$adapter = Nuo::getObject('social/adapter/live');

		$clientApi = $adapter -> getClientApi();
		
		$clientApi->setDebug(TRUE);
		
		$action = @$_REQUEST['action'];

		$consent = NULL;
		$token = NULL;

		if ($action == 'delauth')
			$consent = $clientApi -> processConsent($_REQUEST);

		if ($consent)
			$tokenString = $consent -> getToken();

		$consentToken = $clientApi -> processConsentToken($tokenString);

		$info = $adapter -> getContacts($consentToken);
		
		var_dump($info);

		exit ;
	}

}
